<template>
  <li class="listItem" @click="toDetail">
		<aside>
			<h2>{{newsItem.title}}</h2>
			<p class="authorInf">				
			  	<span class='date'>{{newsItem.date|getYMD}}</span>
			  	<span class="fl">&nbsp;&nbsp;{{newsItem.author_name}}</span>
			</p>
		</aside>
		<aside>
			<img :src="newsItem.imgURL" >
		</aside>
  </li>
</template>
 
<script>
	export default {
		name: 'NewsCell',
		props: {
			newsItem: Object
		},
		data () {
			return {} 
		},
		methods:{
			toDetail:function () {
				 window.location.href = "/#/detail";
			}
		}
	}
</script>
 
<style scoped>
	.listItem{
		width: 100%-0.8rem;
		font-size: 0.6rem;
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		margin:0 0.4rem;
		border-top: 1px solid #eaeaea;
		padding:.5rem;
		text-align: left;
	}
	.listItem aside:first-child{
		padding-right: .5rem;
	}
	.date{
		color:#999;
	}
	.authorInf{
		font-size: 0.6rem;
	}
	aside>img{
		border-radius: .2rem
	}
</style>